Ext.onReady(function(){
    // second tabs built from JS
    var tabs = new Ext.TabPanel({
        id: 'searchOrderTabs',
        renderTo: document.body,
        activeTab: 0,
        width: '100%',
        height: 700,
        plain: true,
        defaults: {
            autoScroll: true
        },
        items: [{
            id: 'searchOrderTab1',
            title: '查找订单',
            autoLoad: {
                url: '/orders/searchOrder',
                scripts: true
            },
            listeners: {
                activate: handleActivate
            }
        }, {
            id: 'searchOrderTab2',
            title: '查找取消订单',
            autoLoad: {
                url: '/orders/searchCancelOrders',
                scripts: true
            },
            listeners: {
                activate: handleActivate
            }
        }, {
            id: 'searchOrderTab3',
            title: '未指定客户订单',
            autoLoad: {
                url: '/orders/noCustomerInfoOrders',
                scripts: true
            },
            listeners: {
                activate: handleActivate
            }
        }, {
            id: 'searchOrderTab4',
            title: '未确认订单',
            autoLoad: {
                url: '/orders/searchWQR',
                scripts: true
            },
            listeners: {
                activate: handleActivate
            }
        }, {
            id: 'searchOrderTab5',
            title: '处理申请单',
            autoLoad: {
                url: '/orders/searchAppOrders',
                scripts: true
            },
            listeners: {
                activate: handleActivate
            }
        }]
    });
    function handleActivate(tab){
        //alert(tab.title + ' was activated.');
    }
});
